home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / procps.postrm < prev    next >
Encoding:
Text File  |  2009-03-18  |  2.5 KB  |  105 lines

  1. #!/bin/sh
  2. # postrm script for procps
  3. #
  4. # see: dh_installdeb(1)
  5.  
  6. set -e
  7.  
  8. # summary of how this script can be called:
  9. #        * <postrm> `remove'
  10. #        * <postrm> `purge'
  11. #        * <old-postrm> `upgrade' <new-version>
  12. #        * <new-postrm> `failed-upgrade' <old-version>
  13. #        * <new-postrm> `abort-install'
  14. #        * <new-postrm> `abort-install' <old-version>
  15. #        * <new-postrm> `abort-upgrade' <old-version>
  16. #        * <disappearer's-postrm> `disappear' <overwriter>
  17. #          <overwriter-version>
  18. # for details, see http://www.debian.org/doc/debian-policy/ or
  19. # the debian-policy package
  20.  
  21. # Undo removal of a no-longer used conffile
  22. undo_rm_conffile()
  23. {
  24.     CONFFILE="$1"
  25.  
  26.     if [ ! -e "$CONFFILE" ]; then
  27.     if [ -e "$CONFFILE".dpkg-bak ]; then
  28.         echo "Restoring modified conffile $CONFFILE"
  29.         mv -f "$CONFFILE".dpkg-bak "$CONFFILE"
  30.     elif [ -e "$CONFFILE".dpkg-obsolete ]; then
  31.         mv -f "$CONFFILE".dpkg-obsolete "$CONFFILE"
  32.     fi
  33.     fi
  34. }
  35.  
  36. # Finish removal of a no-longer used conffile
  37. finish_rm_conffile()
  38. {
  39.     CONFFILE="$1"
  40.  
  41.     if [ -e "$CONFFILE".dpkg-bak ]; then
  42.     rm -f "$CONFFILE".dpkg-bak
  43.     fi
  44. }
  45.  
  46. restoreoldconffile()
  47. {
  48.   v=$1
  49.   f=/etc/init.d/procps
  50.   c=1:3.2.7-5
  51.   [ ! -e "$f" ] && return
  52.   dpkg --compare-versions "$1" ge "$c" || return
  53.   mv "$f" "$f.sh"
  54. }
  55.  
  56. case "$1" in
  57.     abort-install|abort-upgrade)
  58.       restoreoldconffile
  59.  
  60.     if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu1; then
  61.         undo_rm_conffile /etc/sysctl.d/10-tcp-timestamps-workaround.conf
  62.     fi
  63.     if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu2; then
  64.         undo_rm_conffile /etc/sysctl.d/10-process-security.conf
  65.     fi
  66.     ;;
  67.     purge)
  68.     if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu1; then
  69.         finish_rm_conffile /etc/sysctl.d/10-tcp-timestamps-workaround.conf
  70.     fi
  71.     if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu2; then
  72.         finish_rm_conffile /etc/sysctl.d/10-process-security.conf
  73.     fi
  74.     ;;
  75.     remove|upgrade|failed-upgrade|disappear)
  76.     ;;
  77.  
  78.     *)
  79.         echo "postrm called with unknown argument \`$1'" >&2
  80.         exit 1
  81.     ;;
  82. esac
  83.  
  84. # dh_installdeb will replace this with shell code automatically
  85. # generated by other debhelper scripts.
  86.  
  87. # Automatically added by dh_makeshlibs
  88. if [ "$1" = "remove" ]; then
  89.     ldconfig
  90. fi
  91. # End automatically added section
  92. # Automatically added by dh_installinit
  93. if [ "$1" = "purge" ] ; then
  94.     update-rc.d procps remove >/dev/null || exit $?
  95. fi
  96. # End automatically added section
  97. # Automatically added by dh_installmenu
  98. if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
  99. # End automatically added section
  100.  
  101.  
  102. exit 0
  103.  
  104.  
  105.